package com.cosina.game.crystallight.model.battle.ability.crystal;

import com.cosina.game.crystallight.model.battle.Ability;
import com.cosina.game.crystallight.model.crystal.Palm;
import com.cosina.game.crystallight.model.crystal.UpgradeSystem;

public class RangeAbility extends Ability {

	@Override
	public int getId() {
		return Ability.RANGE;
	}

	@Override
	public int needMana() {
		return -1;
	}
	
	public final boolean canActive(){
		return UpgradeSystem.canRangeUpdate(Palm.getContainer().get());
	}

	@Override
	public void doHandler() {
		if(canActive()){
			UpgradeSystem.upgradeRange(Palm.getContainer().get());
		}
	}

	@Override
	public final int getFrameId(){
		if(canActive())
			return getId();
		else
			return -getId();
	}
}
